In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'

Hello,

In DXL Scripting it is necessary to preserve all the objects which are going to be purged. Reason is that purging an object deletes the object completely and not even baseline preserves it.

The evaluation should be the following:

1)All objects with Status = deleted should be exported into an excel file. But: There should be only one excel file for each folder(Folder contains many modules). This means, if script is run multiple times, each time all Objects which are deleted, get added to the same excel file (e.g. Excel files are stored should be stored in desktop).

Regards,

Shri


KBSri - Tue Jul 30 09:15:35 EDT 2013

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
llandale - Tue Jul 30 14:04:05 EDT 2013

If it is a *.xls file you could use OLE to open it in Excel and manipulate it by inserting rows at the right spot.  I think perhaps that would be pretty slow.

If the Excel file is TSV or CSV you could read the entire contents into a Skip based on ObjID; then add to the skip any "deleted" Objects (ignoring duplicates), then write the Skip back out entirely overwriting the previous file.  Problem here is reading the file correctly.

-Louie

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
llandale - Tue Jul 30 14:04:54 EDT 2013

If you baseline the module and THEN purge, the baseline indeed contains the to-be-purged objects.

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
KBSri - Wed Jul 31 02:51:51 EDT 2013

llandale - Tue Jul 30 14:04:54 EDT 2013

If you baseline the module and THEN purge, the baseline indeed contains the to-be-purged objects.

Yes Louie. Thats' correct. I checked it.

But can you please let me know how to proceed in DXL scripting for this particular requirement.

-Shri

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
GregM_dxler - Wed Jul 31 08:32:29 EDT 2013

KBSri - Wed Jul 31 02:51:51 EDT 2013

Yes Louie. Thats' correct. I checked it.

But can you please let me know how to proceed in DXL scripting for this particular requirement.

-Shri

Hello,

Sounds like someone doesn't trust DOORS. :-) 

Louie has an interesting idea on how to proceed.  The trick is to not duplicate the already deleted object entries. 

Questions though, what attributes are you trying to save in the file?  Just the OID, or the OID and something else?  Do you also want to save any other information with it, like the date/time it was deleted, baseline version of the module, etc.?  Do the entires have to be in order?

Greg

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
KBSri - Thu Aug 01 01:42:53 EDT 2013

GregM_dxler - Wed Jul 31 08:32:29 EDT 2013

Hello,

Sounds like someone doesn't trust DOORS. :-) 

Louie has an interesting idea on how to proceed.  The trick is to not duplicate the already deleted object entries. 

Questions though, what attributes are you trying to save in the file?  Just the OID, or the OID and something else?  Do you also want to save any other information with it, like the date/time it was deleted, baseline version of the module, etc.?  Do the entires have to be in order?

Greg

Hello Greg,

Definitely not. I trust DOORS.

I will explain the requirement in detail.

The main objective of the requirement is preserving the deleted object which are going to be purged.

Consider the folder say (Sample), the Sample folder contains number of modules. In each module, I need to export all the objects with the attribute 'Status == Deleted' to a EXCEL file.

The EXCEL can be store at your desktop with a any  valid name. Every time the script runs, all the objects with 'Status == Deleted' should be added to the EXCEL file.

Yes as Louie suggested we can avoid duplication by using Skip.

Please give your valuable suggestion in DXL scripting.

_Shri

 

 

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
GregM_dxler - Thu Aug 01 12:32:46 EDT 2013

KBSri - Thu Aug 01 01:42:53 EDT 2013

Hello Greg,

Definitely not. I trust DOORS.

I will explain the requirement in detail.

The main objective of the requirement is preserving the deleted object which are going to be purged.

Consider the folder say (Sample), the Sample folder contains number of modules. In each module, I need to export all the objects with the attribute 'Status == Deleted' to a EXCEL file.

The EXCEL can be store at your desktop with a any  valid name. Every time the script runs, all the objects with 'Status == Deleted' should be added to the EXCEL file.

Yes as Louie suggested we can avoid duplication by using Skip.

Please give your valuable suggestion in DXL scripting.

_Shri

 

 

Maybe this will give you a start.  The basic process routine comes from Tony Goodman.

The script outputs csv files that can be read by excel.  They are easier to use then excel.  Once you have the module set up to display the information you want, maybe you can figure out how to use the export to excel.  There are several threads talking about that and I think Tony has a script for it as well.

The script does not do any checking if the deleted object is already in a file.

Good luck,

Greg


Attachments

Process_Formal_Modules.dxl

Re: In DXL Scripting export of the particular object to excel file if the value of the attirbute is ''deleted'
llandale - Fri Aug 02 13:46:25 EDT 2013

KBSri - Thu Aug 01 01:42:53 EDT 2013

Hello Greg,

Definitely not. I trust DOORS.

I will explain the requirement in detail.

The main objective of the requirement is preserving the deleted object which are going to be purged.

Consider the folder say (Sample), the Sample folder contains number of modules. In each module, I need to export all the objects with the attribute 'Status == Deleted' to a EXCEL file.

The EXCEL can be store at your desktop with a any  valid name. Every time the script runs, all the objects with 'Status == Deleted' should be added to the EXCEL file.

Yes as Louie suggested we can avoid duplication by using Skip.

Please give your valuable suggestion in DXL scripting.

_Shri

 

 

Well, instead of creating a Stream with "write(NameFile)" open it with "append(NameFile)".  Something like this:

  • Stream out = append(NameFile)
  • for o in entire mod do
  • {  if (o is to be deleted) then out <<identifier(o) "\t" (obj."Object Text") "\t" other attrbutes "\n"
  • }
  • flush(out)
  • close(out)

But, you need to replace all natural TABS and EOLS in the text to some holding pattern, perhaps two spaces.

-Louie